import api from "@/api/api";

let taskDict = [];

const rule = {
  queryParams: [],
  metadata: [
    {
      name: "task_code",
      memo: "任务",
      dictListFun: async () => taskDict,
    },
    {
      name: "status",
      memo: "任务状态",
    },
  ],
};

export default async function () {
  let res = await api.taskList();
  taskDict = res.map((item) => ({
    name: item.name,
    val: item.taskCode,
  }));
  return rule;
}
